//
//  TopicsTableViewCell.m
//  觅影
//
//  Created by lanou on 16/4/8.
//  Copyright © 2016年  陶虹. All rights reserved.
//

#import "TopicsTableViewCell.h"

@interface TopicsTableViewCell ()



@end

@implementation TopicsTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(TopicsMainModel *)model
{
    _model  = model;
    if ([model.poster isEqualToString:@""]) {
        self.picImageView.hidden = YES;
        if ([model.is_hot integerValue] == 0) {
            self.titleX.constant = 15;
            self.hotImageView.hidden = YES;
        }
        else
        {
             self.hotX.constant = 15;
            self.titleX.constant = 48;
            self.hotImageView.hidden = NO;
        }
    }
    else
    {
        self.picImageView.hidden = NO;
        if ([model.is_hot integerValue] == 0) {
            self.titleX.constant = 50;
            self.hotImageView.hidden = YES;
        }
        else
        {
            self.hotImageView.hidden = NO;
        }
        
    }
    
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.poster]];
    self.titleLabel.text = model.title;
    [self.commentButton setTitle:[NSString stringWithFormat:@"%ld回复",[model.reply_num integerValue]] forState:UIControlStateNormal];
    
    
}

@end
